﻿Imports Microsoft.VisualBasic

Imports Microsoft.VisualStudio.TestTools.UnitTesting

Imports omen02



'''<summary>
'''This is a test class for ProductoNegocioTest and is intended
'''to contain all ProductoNegocioTest Unit Tests
'''</summary>
<TestClass()> _
Public Class ProductoNegocioTest


    Private testContextInstance As TestContext

    '''<summary>
    '''Gets or sets the test context which provides
    '''information about and functionality for the current test run.
    '''</summary>
    Public Property TestContext() As TestContext
        Get
            Return testContextInstance
        End Get
        Set(ByVal value As TestContext)
            testContextInstance = Value
        End Set
    End Property

#Region "Additional test attributes"
    '
    'You can use the following additional attributes as you write your tests:
    '
    'Use ClassInitialize to run code before running the first test in the class
    '<ClassInitialize()>  _
    'Public Shared Sub MyClassInitialize(ByVal testContext As TestContext)
    'End Sub
    '
    'Use ClassCleanup to run code after all tests in a class have run
    '<ClassCleanup()>  _
    'Public Shared Sub MyClassCleanup()
    'End Sub
    '
    'Use TestInitialize to run code before running each test
    '<TestInitialize()>  _
    'Public Sub MyTestInitialize()
    'End Sub
    '
    'Use TestCleanup to run code after each test has run
    '<TestCleanup()>  _
    'Public Sub MyTestCleanup()
    'End Sub
    '
#End Region


    '''<summary>
    '''A test for ProductoNegocio Constructor
    '''</summary>
    <TestMethod()> _
    Public Sub ProductoNegocioConstructorTest()
        Dim target As ProductoNegocio = New ProductoNegocio()
        Assert.Inconclusive("TODO: Implement code to verify target")
    End Sub

    '''<summary>
    '''A test for actualizar
    '''</summary>
    '''<TestMethod()> _
    Public Sub actualizarTest()


        Dim neg As New ProductoNegocio

        Try

            neg.actualizar(9, 3, " S/.450.00", "Krazhito_xd", "Sonic_+naki", "000326", "1", "15pix_HD_Max_speed", "camara", "")


        Catch ex As ApplicationException
            Assert.Fail("Falló la prueba")

        End Try





    End Sub

    '''<summary>
    '''A test for buscarPorNombre
    '''</summary>
    '''<TestMethod()> _
    Public Sub buscarPorNombreTest()

        Dim neg As New ProductoNegocio

        Try

            Dim o = neg.buscarPorNombre(tipo:="camara")

            MsgBox(o.Count)

        Catch ex As ApplicationException

            Assert.Fail("Falló la prueba")

        End Try






    End Sub

    '''<summary>
    '''A test for eliminar
    '''</summary>
    '''<TestMethod()> _
    Public Sub eliminarTest()


        Dim neg As New ProductoNegocio

        Try

            neg.eliminar(idProducto:=14)

            MsgBox("Se elimino correctamente")
        Catch ex As ApplicationException

            Assert.Fail("Falló la prueba")

        End Try

        





    End Sub

    '''<summary>
    '''A test for insertar
    '''</summary>
    '''<TestMethod()> _
    Public Sub insertarTest()


        Dim neg As New ProductoNegocio

        Try

            Dim o = neg.insertar(3, " S/. 53.00", "Camachin", "", "", "", "blanca", "canaleta", "25 metros")

        Catch ex As ApplicationException
            Assert.Fail("Falló la prueba")

        End Try

    End Sub


    '''<summary>
    '''A test for listar
    '''</summary>
    '''<TestMethod()> _
    Public Sub listarTest()



        Dim neg As New ProductoNegocio

        Try

            Dim o = neg.listar()

            MsgBox(o.Count)


        Catch ex As ApplicationException
            Assert.Fail("Falló la prueba")

        End Try






    End Sub
End Class
